<template>
  <div class="family-tree-container">
    <div class="tree-wrapper">
      <div class="tree-header">家族族谱树</div>
      <FamilyChildrenRow :children="treeData" :rootLevel="true" />
    </div>
  </div>
</template>

<script>
import { buildCoupleTree } from '@/utils/familyTreeUtil';
import FamilyChildrenRow from './FamilyChildrenRow.vue';

export default {
  name: 'FamilyTree',
  components: { FamilyChildrenRow },
  props: {
    members: {
      type: Array,
      required: true
    }
  },
  computed: {
    treeData() {
      return buildCoupleTree(this.members);
    }
  }
};
</script>

<style scoped>
.family-tree-container {
  width: 100%;
  min-height: 100vh;
  background: #f5f5f5;
}
.tree-header {
  padding: 20px;
  background: #fff;
  border-bottom: 1px solid #eee;
  text-align: center;
}
.tree-wrapper {
  min-width: 0;
  min-height: 100vh;
  max-width: 100vw;
  width: 100vw;
  overflow-x: auto;
  overflow-y: auto;
  padding: 40px 0;
  position: relative;
  background: #f5f5f5;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.family-couple-tree {
  width: 100%;
  max-width: 1800px;
  margin: 0 auto;
}
</style> 